<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        var arr1 = [2, 4, 3, 5];
        arr1.push(10);
        console.log(arr1);

        var str = 'hello world';
        var str1 = str.substr(3, 2);
        console.log(str);
        console.log(str1);
        var str2 = "我爱你";
        console.log(str2.repeat(10));
        var str3 = "某日本人来中国大秀书法,他是日本的女明星";
        console.log(str3.replace(/日本/g, "XX"));
        // trim()去除左右两端的空格

    </script>
</body>

</html>